import QtQml 2.0
import QtQuick 2.9

import QtQuick.Controls 2.0

//import TaoQuick 1.0

Rectangle {
    color: "lightblue"
    width: 1920
    height: 720
    id: normal
/*
    property int speed: 140

    property bool bSpdClock: true
    Timer {
        interval: 50
        repeat: true
        running: true
        onTriggered: {
            if (bSpdClock) {
                if ((normal.speed+1) > 140) bSpdClock=false;
                else normal.speed += 1;
            } else {
                if ((normal.speed-1) < 0) bSpdClock=true;
                else normal.speed -= 1;
            }
        }
    }

    Image{
        anchors.fill: parent
        source: "qrc:/res/bg.png"
    }

    Item{
        y : 257
        width: 846
        height: 98
        clip: true
        Image {
            x : normal.speed/140*820 - 820
            source: "qrc:/res/left.png"
        }
    }

    Item {
        width: 710
        height: 371
        x: 0  //normal.speed/140*710 - 710
        y:340
        ShaderEffect {
            anchors.fill: parent
            property real speeds: normal.speed/140.0
            property variant source: Image
            {
                source: "qrc:/res/water_l.png"
                fillMode: Image.Pad
            }

            fragmentShader: "
                uniform sampler2D source;
                varying highp vec2 qt_TexCoord0;
                uniform highp float speeds;
                void main() {
                    highp vec2 uv = qt_TexCoord0;
                    highp vec4 color = texture2D(source, uv);
                    highp float a = smoothstep(0.0, speeds, uv.x);
                    //color.rgb *= 2.0;
                    color = mix(color,vec4(0.0),a);
                    gl_FragColor = color;
                }
            "
        }
    }



    //soc
   Item {
       width: 710
       height: 371
       anchors.right: parent.right
       anchors.rightMargin: 0
       y:340
       ShaderEffect {
           anchors.fill: parent
           property real socs: normal.speed/140.0
           property variant source: Image {
               source: "qrc:/res/rightwater.png"
           }

           fragmentShader: " \
               uniform sampler2D source; \
               varying highp vec2 qt_TexCoord0; \
               uniform highp float socs; \
               void main() { \
                   highp vec2 uv = qt_TexCoord0; \
                   highp vec4 color = texture2D(source, uv); \
                   highp float a = smoothstep(0.,socs,1.001-uv.x); \
                   color.rgb *= 1.0; \
                   color = mix(color,vec4(0.),a); \
                   gl_FragColor = color; \
               }"
        }
   }

   Image {
       x: 1920 - (Math.abs(normal.speed)*727)/140.0
       y: 257
       source: "qrc:/res/right.png"
   }

    Image{
        anchors.fill: parent
        source: "qrc:/res/bg_moutain.png"
    }
*/




    Loader {
        id: rootLoader
        anchors.centerIn: parent

        Component.onCompleted: {
            source = "qrc:/Louver.qml"
        }
    }




}
